﻿package biz;

import bean.*;
import mapper.UserMapper;

import java.util.List;
import java.util.Stack;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserBizImpl implements  UserBiz{
	  @Autowired 
    private UserMapper um;
    public List<Integer> findUserByCompanyId(int CompanyId){
        return um.findUserByCompanyId(CompanyId);
    }
    public List<Integer>  findAllCompanyId(){
        return um.findAllCompanyId();
    }
    public  void sendMessage(Company company){
        um.sendMessage(company);
    }
    public   List<CompanyContext>reciveMessage(int companyId){
        return um.reciveMessage(companyId);
    }
    public  List<Company>findAllMessage(int userId){
        return um.findAllMessage(userId);
    }
	public void changeState(int contentId) {
		 um.changeState(contentId);
	}
	public void changeUser(int contentId) {
		// TODO Auto-generated method stub
		um.changeUser(contentId);
	}
	 
	@Override
	public Integer timer(String liveBroadcastTime) {
		 
		return um.timer(liveBroadcastTime);
	}
	  @Override
    public UserInfo findAll() {
        return um.findAll();
    }
    @Override
    public void insertUser(UserInfo ui) {
         um.InsertUser(ui);
    }

    @Override
    public List<CompanyInfo> findAllCompany() {
        return um.findAllCompany();
    }
    @Override
    public CompanyInfo findCompanyId(Integer companyId) {
        return um.findCompanyId(companyId);
    }
    //��ѯ�ɼ�
    @Override
    public ScoreInfo findAllScore(ScoreInfo si) {
        return um.findAllScore(si);
    }

    @Override
    public StudygroupnumberInfo findStudygroupnumber(StudygroupnumberInfo si) {
        return um.findStudygroupnumber(si);
    }

    //��ѯ�γ���Ϣ
    @Override
    public List<CourseInfo> findAllCourse(CourseInfo ci) {
        return um.findAllCourse(ci);
    }
	
   @Override
    public CourseInfo findAllCourseId(int courseId) {
        return um.findAllCourseId(courseId);
    }

    @Override
    public Stack<TrainingItemBankInfo> findAllTrainingItemBankInfo(Integer examId) {
        return um.findAllTrainingItemBankInfo(examId);
    }

    @Override
    public void InsertAnswer(AnswerCardInfo answerCardInfo) {
        um.InsertAnswer(answerCardInfo);
    }

    @Override
    public List<CourseUserList> findAllUserCourse(Integer usersId) {
        return um.findAllUserCourse(usersId);
    }

    @Override
    public ExamInfo findAllExam(Integer examId) {
        return um.findAllExam(examId);
    }
    
    //
    @Override
    public String findPasswd(int usersId) {
        return um.findPasswd(usersId).getPasswd();
    }
    public void changePasswd(Integer usersId,String newpasswd) {
        UserInfo ui = um.findPasswd(usersId);
        ui.setUsersId(usersId);
        ui.setPasswd(newpasswd);
        um.changePasswd(ui);
    }
    @Override
    public void changeAvatarPath(Integer usersId, String newavatarPath) {
        UserInfo ui=new UserInfo();
        ui.setAvatarPath(newavatarPath);
        um.changeAvatarPath(ui);
    }

    @Override
    public List<Integer> findstudyGroupNumber(int usersId) {
        return um.findstudyGroupNumber(usersId);
    }

    @Override
    public List<Integer> findcourseId(int studyGroupNumber) {
        return um.findcourseId(studyGroupNumber);
    }

    @Override
    public List<Integer> findexamId(int courseId) {
        return um.findexamId(courseId);
    }

    @Override
    public List<scoreInfo> findmassage(int examId) {
        return um.findmassage(examId);
    }

    @Override
    public void setRank(rank rank) {
        um.setRank(rank);
    }

    @Override
    public List<String> findstudyName(studyGroupNumber stn) {
        return um.findstudyName(stn);
    }

    @Override
    public List<String> findexamName(int examId) {
        return um.findexamName(examId);
    }

    @Override
    public List<scoreInfo> findScore(int usersId) {
        return um.findScore(usersId);
    }
 
}
